import request from './request';

// 登录
export const login = (data) => {
	return request({
		url: 'recruit-login/login/loginByPwd',
		method: 'GET',
		data
	});
};

// 使用验证码登录
export const loginCode = (data) => {
	return request({
		url: 'recruit-login/login/loginByCode',
		method: 'GET',
		data
	});
}

// 注册
export const register = (data) => {
	return request({
		url: 'recruit-register/register/user',
		method: 'GET',
		data
	})
}

// 获取唯一识别码
export const getUUID = () => {
	return request({
		url: 'recruit-login/login/UUID',
		method: 'GET'
	})
}

// 获取验证码
export const getCode = () => {
	return request({
		url: 'recruit-login/login/code',
		method: 'GET'
	})
}

// 获取求职意向
export const getIntentions = (data) => {
	return request({
		url: 'recruit-main/intentions/get',
		merthod: 'GET',
		data
	})
}

// 根据id获取求职意向
export const getIntentionsById = (data) => {
	return request({
		url: 'recruit-main/intentions/getById',
		merthod: 'GET',
		data
	})
}

// 获取行业职位
export const getindustry = () => {
	return request({
		url: 'recruit-main/industry/get',
		merthod: 'GET'
	})
}

// 获取个人信息
export const getCandidateMessage = (data) => {
	return request({
		url: 'recruit-personal/personal/getCandidateMessage',
		method: 'GET',
		//限定死，记得改
		data
	})
}
//修改个人信息
export const updateCandidateMessage = (data) => {
	return request({
		url: 'recruit-personal/personal/updateCandidateMessage',
		method: 'POST',
		data
	})
}
//获取用户的简历
export const getUserResume = (data) => {
	return request({
		url: 'recruit-personal/resume/getUserResume',
		method: 'GET',
		//限定死，记得改
		data: {
			candidateId: 1
		}
	})
}
//修改简历信息
export const updateUserResume = (data) => {
	return request({
		url: 'recruit-personal/resume/updateUserResume',
		method: 'POST',
		//限定死，记得改
		data
	})
}
//获取工作经历
export const getUserWorkExp = (data) => {
	return request({
		url: 'recruit-personal/resume/getUserWorkExp',
		method: 'GET',
		data
	})
}
//添加用户工作经历
export const addUserWorkExp = (data) => {
	return request({
		url: 'recruit-personal/resume/addUserWorkExp',
		method: 'POST',
		data
	})
}
//修改用户工作经历
export const updateUserWorkExp = (data) => {
	return request({
		url: 'recruit-personal/resume/updateUserWorkExp',
		method: 'POST',
		data
	})
}
//删除工作经历
export const delUserWorkExp = (data) => {
	return request({
		url: 'recruit-personal/resume/delUserWorkExp',
		method: 'GET',
		data
	})
}
//获取项目经历
export const getUserProExp = (data) => {
	return request({
		url: 'recruit-personal/resume/getUserProExp',
		method: 'GET',
		data
	})
}
//添加项目经历
export const addUserProExp = (data) => {
	return request({
		url: 'recruit-personal/resume/addUserProExp',
		method: 'POST',
		data
	})
}
//修改工作经历
export const updateUserProExp = (data) => {
	return request({
		url: 'recruit-personal/resume/updateUserProExp',
		method: 'POST',
		data
	})
}
//删除用户工作经历
export const delUserExp = (data) => {
	return request({
		url: 'recruit-personal/resume/delUserExp',
		method: 'GET',
		data
	})
}
//获取教育经历
export const getUserEduExp = (data) => {
	return request({
		url: 'recruit-personal/resume/getUserEduExp',
		method: 'GET',
		data
	})
}
//添加教育经历
export const addUserEduExp = (data) => {
	return request({
		url: 'recruit-personal/resume/addUserEduExp',
		method: 'POST',
		data
	})
}
//修改教育经历
export const updateEduExp = (data) => {
	return request({
		url: 'recruit-personal/resume/updateEduExp',
		method: 'POST',
		data
	})
}
//删除教育经历
export const delEduExp = (data) => {
	return request({
		url: 'recruit-personal/resume/delEduExp',
		method: 'GET',
		data
	})
}
//个人信息修改保存
export const savePersonalMessage = (data) => {
	return request({
		url: '',
		method: 'POST',
		data
	})
}

// 通过标签、地址、关键字查询工作列表
export const getWork = (data) => {
	return request({
		url: 'recruit-main/work/getByPID',
		method: 'GET',
		data
	})
}

// 通过筛选查询工作列表
export const getWorkByFilter = (data) => {
	return request({
		url: 'recruit-main/work/getByFilter',
		method: 'POST',
		data
	})
}

// 保存求职期望
export const saveIntention = (data) => {
	return request({
		url: 'recruit-main/intentions/save',
		method: 'POST',
		data
	})
}


// 获取职业详情
export const getWorkDetail = (data) => {
	return request({
		url: 'recruit-main/work/getById',
		method: 'GET',
		data
	})
}

// 获取社区动态
export const getCommunity = (data) => {
	return request({
		url: 'recruit-community/communities/get',
		method: 'GET',
		data
	})
}

// 获取动态详情
export const getCommunityDetail = (data) => {
	return request({
		url: 'recruit-community/communities/getByCommunityId',
		method: 'GET',
		data
	})
}

// 获取动态评论
export const getCommunityComment = (data) => {
	return request({
		url: 'recruit-community/comment/get',
		method: 'GET',
		data
	})
}

// 发布动态
export const publishCommunity = (data) => {
	return request({
		url: 'recruit-community/communities/add',
		method: 'POST',
		data
	})
}

// 删除动态
export const deleteCommunity = (data) => {
	return request({
		url: 'recruit-community/communities/delete',
		method: 'GET',
		data
	})
}

// 举报动态
export const reportCommunity = (data) => {
	return request({
		url: 'recruit-community/communities/report',
		method: 'GET',
		data
	})
}

// 发布评论
export const publishComment = (data) => {
	return request({
		url: 'recruit-community/comment/add',
		method: 'POST',
		data
	})
}

// 删除评论
export const deleteComment = (data) => {
	return request({
		url: 'recruit-community/comment/delete',
		method: 'GET',
		data
	})
}

// 动态点赞
export const likeCommunity = (data) => {
	return request({
		url: 'recruit-community/like/add',
		method: 'GET',
		data
	})
}

// 评论点赞
export const likeComment = (data) => {
	return request({
		url: 'recruit-community/like/addCommentLike',
		method: 'GET',
		data
	})
}

// 动态取消点赞
export const unlikeCommunity = (data) => {
	return request({
		url: 'recruit-community/like/delete',
		method: 'GET',
		data
	})
}

// 评论取消点赞
export const unlikeComment = (data) => {
	return request({
		url: 'recruit-community/like/deleteCommentLike',
		method: 'GET',
		data
	})
}

// 添加收藏
export const addCollection = (data) => {
	return request({
		url: 'recruit-community/star/add',
		method: 'GET',
		data
	})
}

// 取消收藏
export const deleteCollection = (data) => {
	return request({
		url: 'recruit-community/star/delete',
		method: 'GET',
		data
	})
}